/*
 * Point.h
 *
 *  Created on: Jun 19, 2009
 *      Author: computer
 */

#ifndef DIMENSION_H_
#define DIMENSION_H_

template<typename T> class Dimension {
public:
	Dimension(T, T);
	virtual ~Dimension();

	Dimension<T>& operator+(const Dimension<T>&);

    T getWidth() const;
    void setWidth(T x);

    T getHeigth() const;
    void setHeigth(T y);

private:
	T x;
	T y;
};

template<typename T> Dimension<T>::Dimension(T _x = 0, T _y = 0) : x(_x), y(_y) { }

template<typename T> Dimension<T>::~Dimension() { }

template<typename T> Dimension<T>& Dimension<T>::operator+(const Dimension<T>& snd) {
	Dimension<T> *ris = new Dimension<T>(x + snd.x, y + snd.y);
	return *ris;
}

template<typename T> T Dimension<T>::getWidth() const {
	return x;
}

template<typename T> T Dimension<T>::getHeigth() const {
	return y;
}

template<typename T> void Dimension<T>::setWidth(T _x) {
	x = _x;
}

template<typename T> void Dimension<T>::setHeigth(T _y) {
	y = _y;
}

#endif /* POINT_H_ */
